Skip to content

SQLite, DuckDB, PostgreSQL: Accept ._name after whitespace in a qualified name - #2677

Open
LucaCappelletti94 wants to merge 3 commits into
mainfrom
tokenizer-dot-underscore
Open

LucaCappelletti94 wants to merge 3 commits into
mainfrom
tokenizer-dot-underscore

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

SELECT t ._a FROM t failed to tokenize with Unexpected character '_', although SQLite 3.51.1, DuckDB 1.4.4 and PostgreSQL 16 all run it and read it as t._a. The tokenizer treats ._ as a period only when the previous token is a word, and with whitespace in between the previous token was the whitespace, so it fell through to number parsing.

The check now looks at the previous token that is not whitespace. A ._ that follows a number, as in SELECT 1 ._a, is still a tokenizer error, and SELECT ._abc with no qualifier is still rejected by the parser. Tests cover these forms in every dialect where _ can start an identifier.

@codecov-commenter

codecov-commenter commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.36%. Comparing base (3330dc9) to head (84e9a63).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2677      +/-   ##
==========================================
+ Coverage   81.31%   81.36%   +0.05%     
==========================================
  Files          42       42              
  Lines       33977    34040      +63     
  Branches    33977    34040      +63     
==========================================
+ Hits        27628    27697      +69     
+ Misses       2785     2783       -2     
+ Partials     3564     3560       -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@LucaCappelletti94
LucaCappelletti94 marked this pull request as draft October 18, 2026 14:12
@LucaCappelletti94
LucaCappelletti94 marked this pull request as ready for review October 18, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants